package com.jiawei.mapper;

import com.jiawei.pojo.TableInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author : willian fu
 * @version : 1.0
 */
@Mapper
public interface TableInfoMapper{

    /**
     * 查询表名信息
     * @param dateBase
     * @return
     */
    @Select("select table_name,table_comment from information_schema.tables where table_schema = #{dateBase}")
    List<Map<String,String>> selectTableInfo(String dateBase);

    /**
     * 查询表结构信息
     * @param tableName
     * @return
     */
    @Select("show full fields from ${tableName}")
    List<Map<String,String>> selectTableContent(@Param("tableName")String tableName);
}
